<?php
namespace app\api\controller;

use think\Controller;
use app\api\model\Classify;

class Classifys extends Controller
{
    public function index()
    {
        if (request()->isGet()){
            AjaxReturn('10020','传值方式错误');
            die;
        }
        if(request()->isPost()) {
            $classify = new Classify();
            $data = $classify->index();
            if ($data == 0) {
                AjaxReturn('10010', '暂无商品分类');
            } else {
                AjaxReturn('1', '成功', ['data' => $data]);
            }
        }
    }
}